package com.mindata.blockchain.block;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * 通过block 解析指令索引内容，方便根据指令hash来追溯指令内容已经所属区块
 * <p>
 * User: jasperxgwang
 * Date: 2018-7-26 14:11
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class InstructionInfo {

    /**
     * 指令hash
     */
    @JsonIgnore
    private String hash;

    /**
     * 区块blockBody指令集中索引
     */
    private int index;
    /**
     * 所属区块hash
     */
    private String blockHash;
    /**
     * 所属区块number
     */
    private long blockNumber;

    public String getHash() {
        return hash;
    }

    public void setHash(String hash) {
        this.hash = hash;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getBlockHash() {
        return blockHash;
    }

    public void setBlockHash(String blockHash) {
        this.blockHash = blockHash;
    }

    public long getBlockNumber() {
        return blockNumber;
    }

    public void setBlockNumber(long blockNumber) {
        this.blockNumber = blockNumber;
    }

    @Override
    public String toString() {
        return "InstructionInfo{" +
                "hash='" + hash + '\'' +
                ", index=" + index +
                ", blockHash='" + blockHash + '\'' +
                ", blockNumber='" + blockNumber + '\'' +
                '}';
    }
}
